package com.jycrm.presentation.components.tree;

import java.io.Serializable;

/**
 * @author phraktle
 */
public interface ITreeManager {

    /**
     * Whether or not node expanded
     * @param element
     * @return
     */
    public boolean isExpanded(Object element);


    /**
     * Sets the element to expanded
     * @param element
     * @param expand
     */
    public void setExpanded(Object element, boolean expand);

    /**
     * Collapses all nodes.
     */
    public void collapseAll();

    /**
     * Expands all
     *
     */
    public void expandAll();

    /**
     * Reveals the object in the tree by adding it and any parents required to
     * reveal it to the current {@link Tree}s state.
     * 
     * @param element
     * @return The top level parent element that had to be revealed in order to
     *         make this component visible, otherwise should return the element
     *         passed in.
     */
    public Object reveal(Object element);

}